package com.lyncs.ods.resp;

import com.fasterxml.jackson.databind.PropertyNamingStrategy;
import com.fasterxml.jackson.databind.annotation.JsonNaming;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;
import java.util.Map;

/**
 * @author alex
 * @date 2022/4/13 23:41
 * @description
 */
@Data
@Accessors(chain = true)
@JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class)
public class UndeliveredOrderSkuResp {

    @ApiModelProperty(value = "order ID")
    private Long orderId;

    @ApiModelProperty(value = "订单名称")
    private String orderName;

    @ApiModelProperty(value = "是否为跳转的订单")
    private Boolean selected;

    @ApiModelProperty(value = "订单创建时间")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "状态")
    private Integer status;

    @ApiModelProperty(value = "sku类目数")
    private Integer categoryCount;

    @ApiModelProperty(value = "总金额")
    private BigDecimal totalAmount;

    @ApiModelProperty(value = "sku信息")
    private List<OrderSkuInfo> skuInfos;

    @Data
    @Accessors(chain = true)
    @JsonNaming(PropertyNamingStrategy.SnakeCaseStrategy.class)
    public static class OrderSkuInfo {

        @ApiModelProperty(value = "交付总数")
        private BigDecimal totalCount;

        @ApiModelProperty(value = "已交付数")
        private BigDecimal deliveredCount;

        @ApiModelProperty(value = "未交付数")
        private BigDecimal undeliveredCount;

        @ApiModelProperty(value = "单位")
        private String unit;

        @ApiModelProperty(value = "订单保存sku时的单价")
        private BigDecimal amount;

        @ApiModelProperty(value = "sku 名称")
        private String name;

        @ApiModelProperty(value = "sku 内部货号")
        private String innerCode;

        @ApiModelProperty(value = "sku ID")
        private Long skuId;

        @ApiModelProperty(value = "sku图片")
        private String imgUrl;

        @ApiModelProperty(value = "sku属性")
        private Map<String, String> skuAttrs;

    }
}
